import Vue from 'vue'
import router from '@/router'
import store from '@/store'
import App from '@/App'

// 导入vant
import Vant from 'vant'
import { Lazyload } from 'vant'
// 导入样式
import 'vant/lib/index.css'
// 导入图标样式
import './assets/fonts/iconfont.css'
// 设置rem
import 'amfe-flexible'

// 导入全局样式
import '@/styles/index.less'

import * as directives from '@/directives'
import * as filters from '@/filters'
// 注册
Vue.use(Vant, Lazyload)
Vue.use(Lazyload, {
  lazyComponent: true
})

Vue.use(Vant)
// 批量注册指令
Object.keys(directives).forEach(val => {
  Vue.directive(val, directives[val])
})
// 批量注册过滤器
Object.keys(filters).forEach(val => {
  Vue.filter(val, filters[val])
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
